package com.banach.prema.enums;

/**
 * @ClassDesc
 * @author ajun
 * @date 2022/11/03 9:20
 **/
public enum RegionType {

    COUNTRY("country","国家"),
    PROVINCE("province","省"),
    CITY("city","市"),
    DISTRICT("district","区"),
    STREET("street","街道"),
    DETAIL("detail","详细地址"),;

    private final String value;
    private final String desc;

    RegionType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static RegionType getRegionType(String value){
        for(RegionType ut : RegionType.values()){
            if(ut.getValue().equals(value)){
                return ut;
            }
        }
        return null;
    }

    public String getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }
}
